export default {

  model: {
    prop: 'value',
    event: 'change',
  },
  props: {
    value: '',
  },
  data() {
    return {
      defaultValue: (typeof this.value) === 'Object' ? JSON.parse(JSON.stringify(this.value)) : this.value,
    }
  },
  watch: {
    value(newVal, oldVal) {
      this.defaultValue = newVal;
    },
    defaultValue(newVal, oldVal) {
      this.$emit('change', newVal);
    }
  }
}
